#! /bin/sh

start(){
  exec java -Xms128m -Xmx2048m -jar splitdata-0.0.1-SNAPSHOT.jar --is.sender=true >/dev/null &
}

stop(){
  pid=`ps -ef | grep splitdata-0.0.1 |grep -v grep |head -n 1 |awk '{print $2}'`;
  echo $pid
  kill $pid
}

case "$1" in 
start)
  start
;;
stop)
  stop
;;
restart)
  stop
  start
;;
*)
printf 'Usage: %s {start|stop|restart}\n' "$prog"
exit 1
;;
esac
